import { WebSocketServer } from "ws";
import { connectionHandler } from "./helpers/connection-handler";

const wss = new WebSocketServer({
	port: 3001,
});
export const socketServerInit = () => {
	wss.on("listening", () => {
		console.log("Socket server is listening");
	});
	wss.on("connection", (client, request) => {
		connectionHandler(client, request);
	});
};
